package book.po;
import java.io.Serializable;

/**
 * 图书
 * @author Dengcj
 *
 */
public class Book implements Comparable<Object>,Serializable{
	private static final long serialVersionUID = 1L;
	private int isbn;
	private String name;
	private double price;
	public Book() {
		super();
	}
	public Book(int isbn, String name, double price) {
		super();
		this.isbn = isbn;
		this.name = name;
		this.price = price;
	}

	@Override
	public int compareTo(Object object) {
		Book bk = (Book) object;
		int difference = (int) ((this.getPrice() - bk.getPrice()) * 10000);
		return difference;
	}

	

	public int getIsbn() {
		return isbn;
	}

	public void setIsbn(int isbn) {
		this.isbn = isbn;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}
	@Override
	public String toString() {
		return "Book [isbn=" + isbn + ", name=" + name + ", price=" + price + "]";
	}
	
}
